package ui.activity;

import android.os.Bundle;
import android.widget.TextView;

import com.fy.fyzf.R;
import com.fy.fyzf.base.BaseActivity;
import com.fy.fyzf.bean.MessageListBean;
import com.fy.fyzf.presenter.MessagePresenter;
import com.fy.fyzf.view.MessageCallback;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MessageDetailActivity extends BaseActivity<MessagePresenter> implements MessageCallback {

    @BindView(R.id.tv_time)
    TextView tvTime;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_detail)
    TextView tvDetail;

    @Override
    protected MessagePresenter createPresenter() {
        return new MessagePresenter(this);
    }

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_message_detail;
    }

    @Override
    public void initView() {
        super.initView();
        setTitleName("详情");
    }

    @Override
    public void initData() {
        super.initData();
//        int id = getIntent().getIntExtra("id", -1);
        MessageListBean.ListBean listBean = (MessageListBean.ListBean) getIntent().getSerializableExtra("data");
        tvTime.setText(listBean.getCreateTime());
        tvTitle.setText(listBean.getMsgTitle());
        tvDetail.setText(listBean.getMsgContent());
        mPresenter.updateMsgForRead(listBean.getMsgId());

    }

    @Override
    public void getMessageSuccess(MessageListBean messageListBean) {

    }

}